import Vue from 'vue';
import Vuex from 'vuex';
// import jwt_decode from "jwt-decode";

Vue.use(Vuex);

const state = {
  isAuthorization: false,
  user: ""
}

const getters = {
  isAuthorization: state => state.isAuthorization,
  user: state => state.user
}

const mutations = {
  getUser (state, user) {
    state.user = user
  },
  getAuthorization (state, isAuthorization) {
    state.isAuthorization = isAuthorization
  }
}

const actions = {

}

export default new Vuex.Store({
  state,
  getters,
  mutations,
  actions
})
